﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;

namespace LRT.Syndication.Components
{
    /// <summary>
    /// RSS 频道
    /// </summary>
    public class Channel
    {
		public Channel()
		{
			Title = String.Empty;
			Link = String.Empty;
			Description = String.Empty;
			Category = String.Empty;
			Cloud = String.Empty;
			Copyright = String.Empty;
			Docs = String.Empty;
			Generator = String.Empty;
			Image = String.Empty;
			Language = String.Empty;
			LastBuildDate = String.Empty;
			ManagingEditor = String.Empty;
			PubDate = String.Empty;
			Rating = String.Empty;
			SkipDays = String.Empty;
			SkipHours = String.Empty;
			TextInput = String.Empty;
			Ttl = String.Empty;
			WebMaster = String.Empty;
		}

        #region required item

        /// <summary>
        /// 编号
        /// </summary>
        [Display(Name = "编号")]
        [DataMember]
        public int ID
        {
            get;
            set;
        }

        /// <summary>
        /// 标题
        /// </summary>
        [Display(Name = "标题")]
        [DataMember]
        [Required]
        public string Title
        {
            get;
            set;
        }

        /// <summary>
        /// 链接
        /// </summary>
        [Display(Name = "链接")]
        [DataMember]
        [Required]
        public string Link
        {
            get;
            set;
        }

        /// <summary>
        /// 描述
        /// </summary>
        [Display(Name = "描述")]
        [DataMember]
        [Required]
        public string Description
        {
            get;
            set;
        }

        #endregion


        //[Display(Name = "文章列表")]
        //public IEnumerable<Item> Items
        //{
        //    get;
        //    set;
        //}

        /// <summary>
        /// 为 feed 定义所属的一个或多个种类
        /// </summary>
        [Display(Name = "种类")]
        [DataMember]
        public string Category
        {
            get;
            set;
        }

        /// <summary>
        /// 注册进程，以获得 feed 更新的立即通知
        /// </summary>
        [Display(Name = "")]
        [DataMember]
        public string Cloud
        {
            get;
            set;
        }

        /// <summary>
        /// 版权
        /// </summary>
        [Display(Name = "版权")]
        [DataMember]
        public string Copyright
        {
            get;
            set;
        }

        /// <summary>
        /// 指向当前 RSS 文件所用格式说明的 URL
        /// </summary>
        [Display(Name = "说明URL")]
        [DataMember]
        public string Docs
        {
            get;
            set;
        }

        /// <summary>
        /// 生成 feed 的程序
        /// </summary>
        [Display(Name = "生成 feed 的程序")]
        [DataMember]
        public string Generator
        {
            get;
            set;
        }

        /// <summary>
        /// 图像
        /// </summary>
        [Display(Name = "图像")]
        [DataMember]
        public string Image
        {
            get;
            set;
        }

        /// <summary>
        /// 指定编写 RSS 文档时所使用的语言 .例如：zh-cn
        /// </summary>
        [Display(Name = "语言")]
        [DataMember]
        public string Language
        {
            get;
            set;
        }

        /// <summary>
        /// 最后修改日期
        /// </summary>
        [Display(Name = "最后修改日期")]
        [DataMember]
        public string LastBuildDate
        {
            get;
            set;
        }

        /// <summary>
        /// 内容编辑的电子邮件地址
        /// </summary>
        [Display(Name = "内容编辑的电子邮件地址")]
        [DataMember]
        public string ManagingEditor
        {
            get;
            set;
        }

        /// <summary>
        /// 最后发布日期
        /// </summary>
        [Display(Name = "最后发布日期")]
        [DataMember]
        public string PubDate
        {
            get;
            set;
        }

        /// <summary>
        /// PICS 级别
        /// </summary>
        [Display(Name = "PICS级别")]
        [DataMember]
        public string Rating
        {
            get;
            set;
        }

        /// <summary>
        /// 规定忽略 feed 更新的天
        /// </summary>
        [Display(Name = "忽略更新天数")]
        [DataMember]
        public string SkipDays
        {
            get;
            set;
        }

        /// <summary>
        /// 规定忽略 feed 更新的小时
        /// </summary>
        [Display(Name = "规定忽略 feed 更新的小时")]
        [DataMember]
        public string SkipHours
        {
            get;
            set;
        }

        /// <summary>
        /// 规定应当与 feed 一同显示的文本输入域 大多数聚合器忽略 <textInput> 元素
        /// </summary>
        [Display(Name = "文本输入域")]
        [DataMember]
        public string TextInput
        {
            get;
            set;
        }

        /// <summary>
        /// 可被缓存的分钟数
        /// </summary>
        [Display(Name = "可被缓存的分钟数")]
        [DataMember]
        public string Ttl
        {
            get;
            set;
        }

        /// <summary>
        /// 管理员电子邮件地址
        /// </summary>
        [Display(Name = "管理员电子邮件地址")]
        [DataMember]
        public string WebMaster
        {
            get;
            set;
        }

    }
}
